<!DOCTYPE html>
<html lang="cn">
<head>
	<meta charset="UTF-8">
	<title>10s倒计时生效按钮</title>
	<style>
	button{
		width:200px;
		height:70px;
		color:#fff;
		background-color:#333;
		font-size:30px;
		font-family: 雅黑;
		border-radius: 30px;
	}
	</style>
</head>
<body >
<h3>10s倒计时生效按钮</h3>
<button id="btn" disabled onclick="alert('已同意!')">同意(10)</button>

<script>
    m = 10;
    function showbtn() {
        var  btn = document.getElementById('btn');
        if (m <= 0) {
            btn.disabled = false;
            btn.innerHTML = '同意';
            return;
        }
        btn.innerHTML = '同意('+m+')';
        m--;
        setTimeout("showbtn()", 1000);
    }

    showbtn();

</script>

</body>
</html>